﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Grupo3.Scenes
{
    public static class SceneManager
    {
        public static SceneBase currentScene;

        public static void setScene(SceneBase nextScene)
        {
            if (currentScene != null)
                currentScene.Terminate();

            currentScene = nextScene;

            if (currentScene != null)
                currentScene.Start();
        }

        public static bool Update(GameTime gameTime)
        {
            if (currentScene == null)
            {
                return false;
            }

            else
            {
                currentScene.Update(gameTime);
                return true;
            }
        }

        public static bool Draw(SpriteBatch spriteBatch)
        {
            if (currentScene == null)
            {
                return false;
            }

            else
            {
                currentScene.Draw(spriteBatch);
                return true;
            }

        }

    }

}


